﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.DataConversion
{
    [Serializable]
    [XmlRootAttribute("root", IsNullable = false)]
    public class ConverDataTabelModel
    {
        [XmlElementAttribute("table", IsNullable = false)]
        public List<TableConverModel> tableConverModelList { get; set; }
    }

    /// <summary>
    /// 表数据
    /// </summary>
    [XmlRootAttribute("table", IsNullable = false)]
    public class TableConverModel
    {
        /// <summary>
        /// 表ID
        /// </summary>
        [XmlAttribute("id")]
        public string id { get; set; }

        /// <summary>
        /// 表名称
        /// </summary>
        [XmlAttribute("name")]
        public string name { get; set; }

        /// <summary>
        /// 上级表id
        /// </summary>
        [XmlAttribute("prentid")]
        public string prentid { get; set; }

        [XmlAttribute("isoverall")]
        public string isoverall { get; set; }
        /// <summary>
        /// 优先级
        /// </summary>
        [XmlAttribute("priority")]
        public string priority { get; set; }

        [XmlElementAttribute("xmlpathList", IsNullable = false)]
        public XmlPathListModel XmlPathListModel { get; set; }
    }
    /// <summary>
    /// 数据源
    /// </summary>
    [Serializable]
    [XmlRootAttribute("xmlpathList", IsNullable = false)]
    public class XmlPathListModel
    {
        /// <summary>
        /// 数据源加载
        /// </summary>
        [XmlElementAttribute("xmlpath", IsNullable = false)]
        public List<XmlPathModel> xmlPathList { get; set; }
    }

    /// <summary>
    /// 内容信息
    /// </summary>
    [Serializable]
    [XmlRootAttribute("xmlpath", IsNullable = false)]
    public class XmlPathModel
    {
        /// <summary>
        /// 路径
        /// </summary>
        [XmlAttribute("value")]
        public string value { get; set; }
        /// <summary>
        /// 数据源标识
        /// </summary>
        [XmlAttribute("code")]
        public string code { get; set; }
        /// <summary>
        /// 查询条件
        /// </summary>
        [XmlAttribute("where")]
        public string where { get; set; }

        /// <summary>
        /// 字段标识
        /// </summary>
        [XmlElementAttribute("field", IsNullable = false)]
        public List<FileNameModel> fileNameModelList { get; set; }

        /// <summary>
        /// 字段信息
        /// </summary>
        [XmlElementAttribute("elment", IsNullable = false)]
        public List<ElmentConvertModel> elmentConvertModelList { get; set; }

        /// <summary>
        /// 获取子节点信息
        /// </summary>
        [XmlElementAttribute("childnode", IsNullable = false)]
        public List<ChildNodeConvertModel> childNodeConvertModels { get; set; }
    }

    /// <summary>
    /// 获取子节点信息
    /// </summary>
    [Serializable]
    [XmlRootAttribute("childnode", IsNullable = false)]
    public class ChildNodeConvertModel
    {
        [XmlAttribute("xmlpath")]
        public string xmlPath { get; set; }

        [XmlElementAttribute("filename", IsNullable = false)]
        public List<FileNameModel> fileNameModelList { get; set; }
    }

    [Serializable]
    [XmlRootAttribute("elment", IsNullable = false)]
    public class ElmentConvertModel
    {
        [XmlAttribute("xmlpath")]
        public string xmlPath { get; set; }

        [XmlElementAttribute("field", IsNullable = false)]
        public List<FileNameModel> fileNameModelList { get; set; }
    }
    /// <summary>
    /// 字段实体
    /// </summary>
    [Serializable]
    [XmlRootAttribute("field", IsNullable = false)]
    public class FileNameModel
    {
        [XmlAttribute("name")]
        public string name { get; set; }
        [XmlAttribute("value")]
        public string value { get; set; }
    }

    /// <summary>
    /// 保存DIC数据
    /// </summary>
    public class DataHandleModelClassThree
    {
        /// <summary>
        /// 唯一ID
        /// </summary>
        //必填特性
        public string OutRelatID { get; set; }
        /// <summary>
        /// 案号
        /// </summary>
        public string CaseCode { get; set; }
        /// <summary>
        /// 案件ID
        /// </summary>
        public string CaseID { get; set; }
        /// <summary>
        /// 文书名称
        /// </summary>
        //必填特性
        public string SourceName { get; set; }

        /// <summary>
        /// 数据源
        /// </summary>
        public Dictionary<string, List<Dictionary<string, string>>> DicTable { get; set; }
    }
}
